package cc.customer.web.login;

import cc.customer.authorization.annotation.CurrentUser;
import cc.customer.common.domain.ResponseBo;
import cc.customer.system.domain.MyUser;
import cc.customer.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @MethodName: $
 * @Description: TODO
 * @Param: $
 * @Return: $
 * @Author: cunfeng
 * @Date: 2020/6/10 17:27
 **/

@Controller
@RequestMapping("/app/user")
public class UserController {

    @Autowired
    UserService userService;


    @RequestMapping(value = "/updateOneUser")
    @ResponseBody
    public ResponseBo updateAppOneUser(MyUser users,@CurrentUser MyUser user){

        users.setUserId(user.getUserId());

        return userService.updateAppOneUser(users );
    }


    @RequestMapping(value = "/selectUserByName")
    @ResponseBody
    public ResponseBo selectUserByName(MyUser users,@CurrentUser MyUser user){

        List<MyUser> myUsers = userService.selectUserByName(users);

        return ResponseBo.ok("查询成功",myUsers);
    }




}
